feat(pipeline-run): add programmatic submit_and_wait#41
Open
arseniy-pplx wants to merge 1 commit into
Open
Conversation
submit_and_wait_prepared_body submits a prepared run body and waits for terminal state in one call. Wait parameters are validated before creating a run, max_wait=None remains unbounded, and submit_recovery_attempts passes through to failed-submit recovery so a run registered before a transport failure can be adopted instead of duplicated. The caller body is never mutated. Also fixes a pre-existing KeyError in submit_prepared_body on locator-style bodies without an inline componentRef.spec, and tightens wait_for_completion to reject non-finite max_wait/poll_interval instead of treating inf as a never-firing deadline.
arseniy-pplx
marked this pull request as ready for review
July 20, 2026 18:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
submit_and_wait_prepared_bodyand the shortersubmit_and_waitalias for programmatic callerslogger=applies only when the helper builds the manager — a suppliedmanager=keeps its own loggermax_wait=Nonefor an unbounded waitsubmit_recovery_attemptsthrough to failed-submit recovery so a registered run can be adopted instead of submitted twiceKeyErrorinPipelineRunManager.submit_prepared_bodyon locator-style bodies (componentRefwithname/digestand no inlinespec); such bodies now submit verbatim with a spec-less run contextwait_for_completion: non-finitemax_wait/poll_interval(NaN/inf) now raisePipelineRunErrorwhereinfpreviously acted as a never-firing deadline;max_wait=Noneremains the unbounded spellingmax_wait (--max-wait) must be non-negative) since the CLI and programmatic API share the validation pathContext
Scripts currently have to reproduce the CLI's submit, recovery and wait orchestration. A single SDK entry point makes that flow reusable without weakening the existing submission-id recovery guarantees.
Testing
uv run pytest tests/test_submit_and_wait_prepared_body.py tests/test_pipeline_runs_cli.pyuvx ruff checkon the touched source filesuv lock --checkgit diff --check